package server.demo.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import server.demo.entity.FileData;

import java.util.List;

@Repository
public interface FileMapper {
    //增加文件信息
    @Insert("INSERT INTO fileserver (uuid,fsize,ftype,fname,createTime,location) VALUES (#{uuid},#{fsize},#{ftype},#{fname},#{createTime},#{location})")
    int addFile(FileData fileData);

    //根据id查询用户信息，id为用户请求的uuid
    @Select("SELECT * FROM fileserver WHERE uuid=#{uuid}")
    FileData queryFileById(String id);
}
